<template>
	<view class="body">
		<view class="menu-wrapper">
			<view class="mitem-wrapper">
				<navigator url="../storage/storage" v-if="rolePopedom.ALLOW_STORAGE">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_in_warehouse.png"></image>
					</view>				
					<view class="m_title">入库扫描</view>
				</navigator>
				<view @tap="showNoPopedom" v-else>
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_in_warehouse.png"></image>
					</view>				
					<view class="m_title">入库扫描</view>
				</view>
			</view>
			<view class="mitem-wrapper">
				<navigator url="../exscan/exscan" v-if="rolePopedom.ALLOW_EX">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_scan_records.png"></image>
					</view>				
					<view class="m_title">扫描记录</view>				
				</navigator>
				<view @tap="showNoPopedom" v-else>
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_scan_records.png"></image>
					</view>				
					<view class="m_title">扫描记录</view>
				</view>
			</view>
			
			<view class="mitem-wrapper">
				<navigator url="../products/products">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_search.png"></image>
					</view>				
					<view class="m_title">产品查询</view>
				</navigator>
			</view>
		</view>
		<view class="menu-wrapper">
			<view class="mitem-wrapper">
				<navigator url="../wrhus/wrhus">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_search2.png"></image>
					</view>				
					<view class="m_title">货位查询</view>
				</navigator>
			</view>
			<view class="mitem-wrapper">
				<navigator url="../offline/offline" v-if="rolePopedom.ALLOW_OFFLINE">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_done.png"></image>
					</view>				
					<view class="m_title">下线扫描</view>
				</navigator>
				<view @tap="showNoPopedom" v-else>
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_done.png"></image>
					</view>				
					<view class="m_title">下线扫描</view>
				</view>
			</view>
			<view class="mitem-wrapper">
				<navigator url="../ex/ex" v-if="rolePopedom.ALLOW_EX">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_ex_warehouse.png"></image>
					</view>				
					<view class="m_title">出库扫描</view>
				</navigator>
				<view @tap="showNoPopedom" v-else>
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_ex_warehouse.png"></image>
					</view>				
					<view class="m_title">出库扫描</view>
				</view>
			</view>
		</view>
		
		<view class="menu-wrapper">
			<view class="mitem-wrapper">
				<navigator url="../syn/syn">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_sync.png"></image>
					</view>								
					<view class="m_title">数据同步</view>
				</navigator>
			</view>
			<view class="mitem-wrapper">
				<navigator url="../offlineoperate/offlineoperate">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_offline.png"></image>
					</view>				
					<view class="m_title">离线操作</view>
				</navigator>
			</view>
			<view class="mitem-wrapper">
				<navigator url="../settings/settings">
					<view class="m_icowrapper">
						<image class="m_ico" src="../../static/icons/icon_setting.png"></image>
					</view>				
					<view class="m_title">设置</view>
				</navigator>
			</view>
		</view>
		<view class="divider"> </view>
		<view class="menu-wrapper with-center">
			<view class="loginUser-wrapper">
				<view class="loginUser-info">
					操作人 : {{user.username}}
				</view>
				<view class="loginUser-info">
					角色 : {{user.rolename}}
				</view>
				<view class="loginUser-info">
					部门 : {{user.departname}}
				</view>
			</view>
			<view class="loginUser-wrapper">
				<view class="loginUser-info">
					当前库 : {{inventlocdef_code}}
				</view>
				<view class="loginUser-info">
					当前货位 : {{wrhus_id}}
				</view>				
				<view class="loginUser-info">
					APP状态 : {{state}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{},
				state:"",
				inventlocdef_code:"",
				wrhus_id:"",
				rolePopedom:{}
			}
		},
		methods: {
			swichTab(){
				uni.switchTab({
					url:'../scan/scan'
				})
			},
			showNoPopedom(){
				// uni.showToast(this.$config.msgs.no_popedom)
				uni.showToast({
					title:this.$config.msgs.no_popedom,
					icon:'none',
					duration:1500
				})
			}
		},
		onShow(){		
			this.user=this.$config.SysConfig.loginedUser;
			this.state=this.$config.SysConfig.APP_ISONLINE?"在线":"离线";
			this.inventlocdef_code=this.$config.SysConfig.inventlocdef_code;
			this.wrhus_id=this.$config.SysConfig.wrhus_id;
			this.rolePopedom=this.$config.SysConfig.currentPopedom;
		}
	}
</script>

<style>
@import url("index.css");
</style>
